#pragma once
#include <torch/torch.h>

// Ported from https://github.com/Po-Hsun-Su/pytorch-ssim
// MIT

class CSSIM {
public:
    CSSIM(int windowSize, int channel) : m_WindowSize(windowSize), m_Channel(channel) {
        m_Window = createWindow();
    };

    torch::Tensor eval(const torch::Tensor& vRendered, const torch::Tensor& vGroundTruth);
private:
    torch::Tensor createWindow();
    torch::Tensor gaussian(float vSigma);

    int m_WindowSize;
    int m_Channel;
    torch::Tensor m_Window;
};

